package com.central.common.feign

import com.central.common.constant.ServiceNameConstants
import com.central.common.entity.Post
import com.central.common.feign.fallback.AttentionServiceFallbackFactory
import com.central.common.feign.fallback.PostServiceFallbackFactory
import com.central.common.feign.fallback.VisitServiceFallbackFactory
import org.springframework.cloud.openfeign.FeignClient
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable

/**
 * @author  fly
 * @date  2021/5/27 17:26
 * @version 1.0
 */
@FeignClient(name = ServiceNameConstants.POST_SERVICE, fallbackFactory = PostServiceFallbackFactory::class, decode404 = true)
interface PostService {


    /**
     * 获取我获得的总赞数
     */
    @GetMapping("/post/getMyPostLikeNum/{userId}")
    fun getMyPostLikeNum(@PathVariable("userId") userId: Long): Long


    /**
     * 获取帖子详情
     */
    @GetMapping("/post/getPostDetail/{id}")
    fun getPostDetail(@PathVariable("id") id: Long): Post?
}